package com.mobile.challenge.web;
import com.mobile.challenge.core.Result;
import com.mobile.challenge.core.ResultGenerator;
import com.mobile.challenge.model.MoreFlowRecord;
import com.mobile.challenge.service.MoreFlowRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Created by Lix on 2018/06/08.
*/
@RestController
@RequestMapping("/flow")
@Api(value = "'更多流量'记录接口",tags = {"'更多流量'按钮点击记录管理"})
public class MoreFlowRecordController {
    @Resource
    private MoreFlowRecordService moreFlowRecordService;

    @RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json"})
    @ResponseStatus(HttpStatus.OK)
    @ApiOperation(value = "记录'更多流量'动作发起", notes = "必须提供一个phoneNo,点击'更多流量'异步请求此接口")
    public Result add(@RequestBody  MoreFlowRecord moreFlowRecord) {
        Map data = new HashMap();
        moreFlowRecordService.save(moreFlowRecord);
        return ResultGenerator.genSuccessResult(data);
    }

}
